@remarkablejames/editor 0.0.3 → 0.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/{ActionMenuButton-D5HLfRzv.js → ActionMenuButton-BUtJUsfO.js} +1 -1
- package/lib/{ActionMenuButton-DN6VHLkp.cjs → ActionMenuButton-M55VtCZ5.cjs} +1 -1
- package/lib/Attachment.cjs +2 -2
- package/lib/Attachment.js +165 -130
- package/lib/Blockquote.cjs +1 -1
- package/lib/Blockquote.js +1 -1
- package/lib/Bold.cjs +1 -1
- package/lib/Bold.js +1 -1
- package/lib/BulletList.cjs +1 -1
- package/lib/BulletList.js +1 -1
- package/lib/Callout.cjs +1 -1
- package/lib/Callout.js +3 -3
- package/lib/Clear.cjs +1 -1
- package/lib/Clear.js +1 -1
- package/lib/Code.cjs +1 -1
- package/lib/Code.js +1 -1
- package/lib/CodeBlock.cjs +1 -1
- package/lib/CodeBlock.js +2 -2
- package/lib/CodeView.cjs +1 -1
- package/lib/CodeView.js +1 -1
- package/lib/Color.cjs +1 -1
- package/lib/Color.js +2 -2
- package/lib/Column.cjs +1 -1
- package/lib/Column.js +1 -1
- package/lib/{Drawer-BN0lYcnJ.cjs → Drawer-CdQBnwUs.cjs} +1 -1
- package/lib/{Drawer-B9l1SoRJ.js → Drawer-mlmJ2nCT.js} +2 -2
- package/lib/Drawer.cjs +1 -1
- package/lib/Drawer.js +2 -2
- package/lib/Emoji.cjs +1 -1
- package/lib/Emoji.js +3 -3
- package/lib/Excalidraw.cjs +1 -1
- package/lib/Excalidraw.js +1 -1
- package/lib/ExportPdf.cjs +1 -1
- package/lib/ExportPdf.js +1 -1
- package/lib/ExportWord.cjs +1 -1
- package/lib/ExportWord.js +1 -1
- package/lib/FontFamily.cjs +1 -1
- package/lib/FontFamily.js +4 -4
- package/lib/FontSize.cjs +1 -1
- package/lib/FontSize.js +4 -4
- package/lib/Heading.cjs +1 -1
- package/lib/Heading.js +4 -4
- package/lib/Highlight.cjs +1 -1
- package/lib/Highlight.js +2 -2
- package/lib/History.cjs +1 -1
- package/lib/History.js +1 -1
- package/lib/HorizontalRule.cjs +1 -1
- package/lib/HorizontalRule.js +1 -1
- package/lib/{Iframe-CXFk3GEq.cjs → Iframe-B_a_AoZc.cjs} +1 -1
- package/lib/{Iframe-MjeJ2OOI.js → Iframe-CYgR99Ny.js} +1 -1
- package/lib/Iframe.cjs +1 -1
- package/lib/Iframe.js +1 -1
- package/lib/Image.cjs +1 -1
- package/lib/Image.js +1 -1
- package/lib/ImageGif.cjs +1 -1
- package/lib/ImageGif.js +3 -3
- package/lib/ImportWord.cjs +1 -1
- package/lib/ImportWord.js +2 -2
- package/lib/{Indent-BPX9XRos.cjs → Indent-BAcoFdaq.cjs} +1 -1
- package/lib/{Indent-CgwDItIf.js → Indent-BMz2ILRl.js} +1 -1
- package/lib/Indent.cjs +1 -1
- package/lib/Indent.js +1 -1
- package/lib/Italic.cjs +1 -1
- package/lib/Italic.js +1 -1
- package/lib/{Katex-CZ4g3vA9.js → Katex-DOlb4iTP.js} +3 -3
- package/lib/{Katex-DIgsR_dS.cjs → Katex-bIhj82VV.cjs} +1 -1
- package/lib/Katex.cjs +1 -1
- package/lib/Katex.js +1 -1
- package/lib/LineHeight.cjs +1 -1
- package/lib/LineHeight.js +3 -3
- package/lib/Link.cjs +1 -1
- package/lib/Link.js +1 -1
- package/lib/{LinkEditBlock-B2bU0Mcr.cjs → LinkEditBlock-Cqs5RxjV.cjs} +1 -1
- package/lib/{LinkEditBlock-CaDV3Vq5.js → LinkEditBlock-xnokk4G7.js} +3 -3
- package/lib/{Mermaid-EhYj_ICn.js → Mermaid-Bs3pIGc6.js} +2 -2
- package/lib/{Mermaid-B9h7XKFo.cjs → Mermaid-DiOdgQv1.cjs} +1 -1
- package/lib/Mermaid.cjs +1 -1
- package/lib/Mermaid.js +1 -1
- package/lib/MoreMark.cjs +1 -1
- package/lib/MoreMark.js +2 -2
- package/lib/OrderedList.cjs +1 -1
- package/lib/OrderedList.js +1 -1
- package/lib/SearchAndReplace.cjs +1 -1
- package/lib/SearchAndReplace.js +3 -3
- package/lib/SlashCommand.cjs +1 -1
- package/lib/SlashCommand.js +3 -3
- package/lib/SlashCommandNodeView-CLimjqhb.cjs +1 -0
- package/lib/{SlashCommandNodeView-CY3peX5x.js → SlashCommandNodeView-CYcf7mVz.js} +78 -88
- package/lib/Strike.cjs +1 -1
- package/lib/Strike.js +1 -1
- package/lib/{Table-Bw7rLue7.js → Table-bz1Wcojf.js} +3 -3
- package/lib/{Table-DLrtX6T7.cjs → Table-dlXTKKwJ.cjs} +1 -1
- package/lib/Table.cjs +1 -1
- package/lib/Table.js +1 -1
- package/lib/TaskList.cjs +1 -1
- package/lib/TaskList.js +1 -1
- package/lib/TextAlign.cjs +1 -1
- package/lib/TextAlign.js +2 -2
- package/lib/TextDirection.cjs +1 -1
- package/lib/TextDirection.js +2 -2
- package/lib/TextUnderline.cjs +1 -1
- package/lib/TextUnderline.js +1 -1
- package/lib/{Twitter-pM0y5Z-L.js → Twitter-CNTXzgt0.js} +3 -3
- package/lib/{Twitter-Ck6vGefg.cjs → Twitter-DhEnGg6P.cjs} +1 -1
- package/lib/Twitter.cjs +1 -1
- package/lib/Twitter.js +1 -1
- package/lib/Video.cjs +1 -1
- package/lib/Video.js +2 -2
- package/lib/bubble.cjs +1 -1
- package/lib/bubble.js +16 -16
- package/lib/{dropdown-menu-nX-u8e2w.js → dropdown-menu-BuSlU2uN.js} +1 -1
- package/lib/{dropdown-menu-DwR8tTs9.cjs → dropdown-menu-CfWNst4v.cjs} +1 -1
- package/lib/extensions/Attachment/Attachment.d.ts +22 -2
- package/lib/{index-_WrFM-Fk.js → index-8B00E8e4.js} +303 -302
- package/lib/index-BrxL7y9p.cjs +1 -0
- package/lib/{index-Dib4cXXf.cjs → index-Bt9LiArC.cjs} +2 -2
- package/lib/{index-4Q5IhypJ.js → index-DZfkCNKr.js} +15 -9
- package/lib/index.cjs +1 -1
- package/lib/index.js +1 -1
- package/lib/locale-bundle.cjs +1 -1
- package/lib/locale-bundle.js +1 -1
- package/lib/locales/en.d.ts +189 -188
- package/lib/locales/fi.d.ts +189 -188
- package/lib/locales/hu.d.ts +189 -188
- package/lib/locales/index.d.ts +1134 -1128
- package/lib/locales/pt-br.d.ts +189 -188
- package/lib/locales/vi.d.ts +189 -188
- package/lib/locales/zh-cn.d.ts +189 -188
- package/lib/{popover-BY7j9SiD.cjs → popover-51mwx3UY.cjs} +1 -1
- package/lib/{popover-CSvY4C-l.js → popover-DMPRgXD3.js} +1 -1
- package/lib/{select-Bu-5iIA9.cjs → select-B7v1Scb-.cjs} +1 -1
- package/lib/{select-BelNLNvT.js → select-BxFDMaZi.js} +1 -1
- package/lib/{separator-Br5kcIJa.js → separator-CpqX9KQC.js} +3 -3
- package/lib/{separator-Cp9Lg3HU.cjs → separator-kB9YUfeO.cjs} +1 -1
- package/lib/style.css +1 -1
- package/lib/{textarea-Ceev4t42.js → textarea-C5DsgzSy.js} +1 -1
- package/lib/{textarea-DfqvYaA6.cjs → textarea-bQSzjqg3.cjs} +1 -1
- package/package.json +1 -1
- package/lib/SlashCommandNodeView-COlWSlnE.cjs +0 -1
- package/lib/index-bVGIXhRg.cjs +0 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsxs as c, jsx as e } from "react/jsx-runtime";
|
|
2
2
|
import { Slot as n } from "@radix-ui/react-slot";
|
|
3
3
|
import r from "react";
|
|
4
|
-
import { i as d, T as m, a as f, B as s, b as u, g } from "./index-
|
|
4
|
+
import { i as d, T as m, a as f, B as s, b as u, g } from "./index-8B00E8e4.js";
|
|
5
5
|
import "./theme.js";
|
|
6
6
|
const C = r.forwardRef(
|
|
7
7
|
({ asChild: x = !1, tooltip: i, ...t }, l) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const e=require("react/jsx-runtime"),a=require("@radix-ui/react-slot"),d=require("react"),i=require("./index-
|
|
1
|
+
"use strict";const e=require("react/jsx-runtime"),a=require("@radix-ui/react-slot"),d=require("react"),i=require("./index-Bt9LiArC.cjs");require("./theme.cjs");const s=d.forwardRef(({asChild:h=!1,tooltip:c,...t},l)=>{var n;const x=i.icons[t.icon],r=h?a.Slot:i.Button;return e.jsxs(i.Tooltip,{children:[e.jsx(i.TooltipTrigger,{asChild:!0,children:e.jsx(r,{className:"richtext-h-[32px] richtext-min-w-24 richtext-overflow-hidden richtext-px-[5px] richtext-py-0","data-state":t!=null&&t.dataState?"on":"off",disabled:t==null?void 0:t.disabled,ref:l,variant:"ghost",...t,children:e.jsxs("div",{className:"richtext-flex richtext-h-full richtext-items-center richtext-font-normal",children:[(t==null?void 0:t.title)&&e.jsx("div",{className:"richtext-grow richtext-truncate richtext-text-left richtext-text-sm",children:t==null?void 0:t.title}),x&&e.jsx(x,{className:"richtext-ml-1 richtext-size-3 richtext-shrink-0 richtext-text-zinc-500"})]})})}),c&&e.jsx(i.TooltipContent,{children:e.jsxs("div",{className:"richtext-flex richtext-max-w-24 richtext-flex-col richtext-items-center richtext-text-center",children:[c&&e.jsx("div",{children:c}),e.jsx("div",{className:"richtext-flex",children:!!((n=t==null?void 0:t.shortcutKeys)!=null&&n.length)&&e.jsx("span",{children:i.getShortcutKeys(t==null?void 0:t.shortcutKeys)})})]})})]})});exports.ActionMenuButton=s;
|
package/lib/Attachment.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("./clsx-CXbNJWDD.cjs"),n=require("./index-Bt9LiArC.cjs"),e=require("react/jsx-runtime"),f=require("react");require("./theme.cjs");const w=require("lucide-react"),V=require("./index-BrxL7y9p.cjs"),v=require("./dom-dataset-BqoJhJXt.cjs"),P={audio:'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-audio-lines"><path d="M2 10v3"/><path d="M6 6v11"/><path d="M10 3v18"/><path d="M14 8v7"/><path d="M18 5v13"/><path d="M22 10v3"/></svg>',video:'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-video"><path d="m16 13 5.223 3.482a.5.5 0 0 0 .777-.416V7.87a.5.5 0 0 0-.752-.432L16 10.5"/><rect x="2" y="6" width="14" height="12" rx="2"/></svg>',file:'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-file"><path d="M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z"/><path d="M14 2v4a2 2 0 0 0 2 2h4"/></svg>',image:'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-image"><rect width="18" height="18" x="3" y="3" rx="2" ry="2"/><circle cx="9" cy="9" r="2"/><path d="m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21"/></svg>',pdf:`<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 32 32">
|
|
2
2
|
<path fill="currentColor" d="M30 18v-2h-6v10h2v-4h3v-2h-3v-2zm-11 8h-4V16h4a3.003 3.003 0 0 1 3 3v4a3.003 3.003 0 0 1-3 3m-2-2h2a1 1 0 0 0 1-1v-4a1 1 0 0 0-1-1h-2zm-6-8H6v10h2v-3h3a2.003 2.003 0 0 0 2-2v-3a2 2 0 0 0-2-2m-3 5v-3h3l.001 3z"></path>
|
|
3
3
|
<path fill="currentColor" d="M22 14v-4a.91.91 0 0 0-.3-.7l-7-7A.9.9 0 0 0 14 2H4a2.006 2.006 0 0 0-2 2v24a2 2 0 0 0 2 2h16v-2H4V4h8v6a2.006 2.006 0 0 0 2 2h6v2Zm-8-4V4.4l5.6 5.6Z"></path>
|
|
4
4
|
</svg>`,word:`<svg
|
|
@@ -16,4 +16,4 @@
|
|
|
16
16
|
fill="currentColor"
|
|
17
17
|
d="m810.667 913.135-.478.068H201.796c-19.865 0-36.727-11.673-36.727-25.6v-618.36h154.965c51.268 0 92.911-39.39 92.911-87.858v-87.86H810.19c19.797 0 36.522 11.742 36.522 25.669V739.26h61.987V119.262c0-46.421-44.169-84.241-98.51-84.241H328.364l-225.28 194.56v658.09c0 46.285 44.236 84.105 98.713 84.105H810.19c43.759 0 80.554-24.713 93.32-58.573h-92.842zM350.89 94.89v86.562c0 16.11-13.858 29.286-30.925 29.286H216.815L350.959 94.891z"
|
|
18
18
|
/>
|
|
19
|
-
</svg>`,excel:'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-sheet"><rect width="18" height="18" x="3" y="3" rx="2" ry="2"/><line x1="3" x2="21" y1="9" y2="9"/><line x1="3" x2="21" y1="15" y2="15"/><line x1="9" x2="9" y1="9" y2="21"/><line x1="15" x2="15" y1="9" y2="21"/></svg>',ppt:'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-table-properties"><path d="M15 3v18"/><rect width="18" height="18" x="3" y="3" rx="2"/><path d="M21 9H3"/><path d="M21 15H3"/></svg>'};function
|
|
19
|
+
</svg>`,excel:'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-sheet"><rect width="18" height="18" x="3" y="3" rx="2" ry="2"/><line x1="3" x2="21" y1="9" y2="9"/><line x1="3" x2="21" y1="15" y2="15"/><line x1="9" x2="9" y1="9" y2="21"/><line x1="15" x2="15" y1="9" y2="21"/></svg>',ppt:'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-table-properties"><path d="M15 3v18"/><rect width="18" height="18" x="3" y="3" rx="2"/><path d="M21 9H3"/><path d="M21 15H3"/></svg>'};function I(t){const s=P[t],o=new DOMParser().parseFromString(s,"image/svg+xml").documentElement,l=["svg",{...Array.from(o.attributes).reduce((r,c)=>(r[c.name]=c.value,r),{})}];return Array.from(o.childNodes).forEach(r=>{if(r.nodeType===1){const c=[r.tagName.toLowerCase(),Array.from(r.attributes).reduce((p,m)=>(p[m.name]=m.value,p),{})];r.textContent&&c.push(r.textContent),l.push(c)}}),l}const R={audio:e.jsx(w.LucideAudioLines,{}),video:e.jsx(w.LucideVideo,{}),file:e.jsx(w.LucideFile,{}),image:e.jsx(w.LucideImage,{}),pdf:e.jsx(n.ExportPdf,{}),word:e.jsx(n.ExportWord,{}),excel:e.jsx(w.LucideSheet,{}),ppt:e.jsx(w.LucideTableProperties,{})};function H(t,s=!1){const i=n.normalizeFileType(t),d=R[i]||e.jsx(e.Fragment,{});return s?I(i):d}const q="_wrap_1is0r_5",W="_placeholder_1is0r_44",$="_placeholderText_1is0r_53",O="_card_1is0r_64",Z="_downloadBtn_1is0r_82",K="_cardLeft_1is0r_88",G="_iconWrap_1is0r_97",J="_fileInfo_1is0r_116",Q="_fileName_1is0r_123",U="_fileSize_1is0r_133",X="_cardPreview_1is0r_145",Y="_actions_1is0r_221",ee="_cardError_1is0r_236",te="_errorText_1is0r_240",a={wrap:q,placeholder:W,placeholderText:$,card:O,downloadBtn:Z,cardLeft:K,iconWrap:G,fileInfo:J,fileName:Q,fileSize:U,cardPreview:X,actions:Y,cardError:ee,errorText:te};function re({editor:t,node:s,updateAttributes:i,deleteNode:d,extension:o}){var L,C;const l=f.useRef(null),r=(t==null?void 0:t.isEditable)??!1,{hasTrigger:c,fileName:p,fileSize:m,fileExt:k,fileType:A,id:h,error:M}=s.attrs,[E,_]=f.useState(!1),{t:j}=V.useLocale(),b=(L=o==null?void 0:o.options)==null?void 0:L.upload,y=(C=o==null?void 0:o.options)==null?void 0:C.onDownload,N=f.useCallback(()=>{var x;!r||h||(x=l.current)==null||x.click()},[h,r]),B=f.useCallback(async x=>{const g=x.target.files&&x.target.files[0];if(!g)return;const F={fileName:n.extractFilename(g.name),fileSize:g.size,fileType:g.type,fileExt:n.extractFileExtension(g.name)};_(!0);try{const T=await b(g);i({...F,id:T}),_(!1)}catch(T){i({error:`File upload fail: ${T&&T.message}`}),_(!1),l.current&&(l.current.value="")}},[_,i,b]);f.useEffect(()=>{!h&&!c&&(N(),i({hasTrigger:!0}))},[h,c,N,i]);const D=f.useCallback(()=>d(),[d]),S=f.useCallback(()=>{!h||!y||y({id:h,fileName:p,fileExt:k,fileType:A,fileSize:m})},[h,p,k,A,m,y]);return r&&!h?e.jsx(u.NodeViewWrapper,{children:e.jsxs("div",{className:u.clsx(a.wrap,a.placeholder,"render-wrapper"),children:[e.jsx("p",{onClick:N,className:a.placeholderText,children:E?e.jsx("span",{children:j("editor.attachment.uploading")}):e.jsx("span",{children:j("editor.attachment.please_upload")})}),e.jsx("input",{hidden:!0,onChange:B,ref:l,type:"file"})]})}):h?e.jsx(u.NodeViewWrapper,{children:e.jsxs("div",{className:u.clsx(a.card,"render-wrapper",{[a.cardPreview]:!r}),children:[e.jsxs("div",{className:a.cardLeft,children:[e.jsx("div",{className:a.iconWrap,children:H(A)}),e.jsxs("div",{className:a.fileInfo,children:[e.jsxs("span",{className:a.fileName,children:[p,".",k]}),e.jsx("span",{className:a.fileSize,children:n.normalizeFileSize(m)})]})]}),e.jsxs("div",{className:a.actions,children:[y&&e.jsx(n.ActionButton,{action:S,icon:"AttachmentDownload",tooltip:j("editor.attachment.download"),customClass:r?void 0:a.downloadBtn}),r&&e.jsx(n.ActionButton,{action:D,icon:"Trash2",tooltip:j("editor.delete")})]})]})}):M&&M!=="null"?e.jsx(u.NodeViewWrapper,{children:e.jsx("div",{className:u.clsx(a.card,a.cardError,"render-wrapper"),children:e.jsx("p",{className:a.errorText,children:M})})}):e.jsx(e.Fragment,{})}function ie(){const t=n.useButtonProps(z.name),{icon:s=void 0,tooltip:i=void 0,shortcutKeys:d=void 0,tooltipOptions:o={},action:l=void 0,isActive:r=void 0}=(t==null?void 0:t.componentProps)??{},{editorDisabled:c,update:p}=n.useToggleActive(r),m=()=>{c||l&&(l(),p())};return t?e.jsx(n.ActionButton,{action:m,disabled:c,icon:s,shortcutKeys:d,tooltip:i,tooltipOptions:o}):e.jsx(e.Fragment,{})}const z=u.Node3.create({name:"attachment",content:"",marks:"",group:"block",selectable:!0,atom:!0,draggable:!0,addOptions(){var t;return{...(t=this.parent)==null?void 0:t.call(this),HTMLAttributes:{class:"attachment"},button:({editor:s,t:i})=>({component:n.ActionButton,componentProps:{action:()=>s.chain().focus().setAttachment().run(),isActive:()=>!1,disabled:!1,icon:"Attachment",tooltip:i("editor.attachment.tooltip")}})}},parseHTML(){return[{tag:"div[class=attachment]"}]},renderHTML({HTMLAttributes:t}){const{id:s="",fileName:i="",fileSize:d="",fileType:o="",fileExt:l=""}=t||{};return["div",u.mergeAttributes(this.options.HTMLAttributes||{},t||{}),s?["span",{class:"attachment__body"},["span",{class:"attachment__icon"},H(o,!0)],["span",{class:"attachment__text"},`${i}.${l} (${n.normalizeFileSize(d)})`]]:["div",{class:"attachment__placeholder"}]]},addAttributes(){return{id:{default:null,parseHTML:v.getDatasetAttribute("id")},fileName:{default:null,parseHTML:v.getDatasetAttribute("filename")},fileSize:{default:null,parseHTML:v.getDatasetAttribute("filesize")},fileType:{default:null,parseHTML:v.getDatasetAttribute("filetype")},fileExt:{default:null,parseHTML:v.getDatasetAttribute("fileext")},hasTrigger:{default:!1,parseHTML:t=>v.getDatasetAttribute("hastrigger")(t)==="true"},error:{default:null,parseHTML:v.getDatasetAttribute("error")}}},addCommands(){return{setAttachment:(t={})=>({chain:s})=>s().insertContent({type:this.name,attrs:t}).run()}},addNodeView(){return u.ReactNodeViewRenderer(re)}});exports.Attachment=z;exports.RichTextAttachment=ie;
|
package/lib/Attachment.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { h as
|
|
2
|
-
import { K as
|
|
3
|
-
import { jsx as e, Fragment as
|
|
4
|
-
import { useRef as
|
|
1
|
+
import { h as H, j as A, N as I, k as R, m as W } from "./clsx-CDyrfCnw.js";
|
|
2
|
+
import { K as $, N as O, O as Z, P as K, Q, R as B, A as T, u as q, d as G } from "./index-8B00E8e4.js";
|
|
3
|
+
import { jsx as e, Fragment as z, jsxs as f } from "react/jsx-runtime";
|
|
4
|
+
import { useRef as J, useState as U, useCallback as y, useEffect as X } from "react";
|
|
5
5
|
import "./theme.js";
|
|
6
|
-
import { LucideTableProperties as
|
|
7
|
-
import { u as
|
|
8
|
-
import { g as
|
|
9
|
-
const
|
|
6
|
+
import { LucideTableProperties as Y, LucideSheet as ee, LucideImage as te, LucideFile as re, LucideVideo as ie, LucideAudioLines as oe } from "lucide-react";
|
|
7
|
+
import { u as ae } from "./index-DZfkCNKr.js";
|
|
8
|
+
import { g as u } from "./dom-dataset-CIEeltF6.js";
|
|
9
|
+
const ne = {
|
|
10
10
|
audio: '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-audio-lines"><path d="M2 10v3"/><path d="M6 6v11"/><path d="M10 3v18"/><path d="M14 8v7"/><path d="M18 5v13"/><path d="M22 10v3"/></svg>',
|
|
11
11
|
video: '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-video"><path d="m16 13 5.223 3.482a.5.5 0 0 0 .777-.416V7.87a.5.5 0 0 0-.752-.432L16 10.5"/><rect x="2" y="6" width="14" height="12" rx="2"/></svg>',
|
|
12
12
|
file: '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-file"><path d="M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z"/><path d="M14 2v4a2 2 0 0 0 2 2h4"/></svg>',
|
|
@@ -34,141 +34,166 @@ const oe = {
|
|
|
34
34
|
excel: '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-sheet"><rect width="18" height="18" x="3" y="3" rx="2" ry="2"/><line x1="3" x2="21" y1="9" y2="9"/><line x1="3" x2="21" y1="15" y2="15"/><line x1="9" x2="9" y1="9" y2="21"/><line x1="15" x2="15" y1="9" y2="21"/></svg>',
|
|
35
35
|
ppt: '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-table-properties"><path d="M15 3v18"/><rect width="18" height="18" x="3" y="3" rx="2"/><path d="M21 9H3"/><path d="M21 15H3"/></svg>'
|
|
36
36
|
};
|
|
37
|
-
function
|
|
38
|
-
const
|
|
37
|
+
function se(t) {
|
|
38
|
+
const a = ne[t], n = new DOMParser().parseFromString(a, "image/svg+xml").documentElement, s = [
|
|
39
39
|
"svg",
|
|
40
40
|
{
|
|
41
|
-
...Array.from(
|
|
41
|
+
...Array.from(n.attributes).reduce((r, l) => (r[l.name] = l.value, r), {})
|
|
42
42
|
}
|
|
43
43
|
];
|
|
44
|
-
return Array.from(
|
|
44
|
+
return Array.from(n.childNodes).forEach((r) => {
|
|
45
45
|
if (r.nodeType === 1) {
|
|
46
|
-
const
|
|
46
|
+
const l = [
|
|
47
47
|
r.tagName.toLowerCase(),
|
|
48
|
-
Array.from(r.attributes).reduce((
|
|
48
|
+
Array.from(r.attributes).reduce((h, p) => (h[p.name] = p.value, h), {})
|
|
49
49
|
];
|
|
50
|
-
r.textContent &&
|
|
50
|
+
r.textContent && l.push(r.textContent), s.push(l);
|
|
51
51
|
}
|
|
52
|
-
}),
|
|
52
|
+
}), s;
|
|
53
53
|
}
|
|
54
|
-
const
|
|
55
|
-
audio: /* @__PURE__ */ e(
|
|
56
|
-
video: /* @__PURE__ */ e(
|
|
57
|
-
file: /* @__PURE__ */ e(
|
|
58
|
-
image: /* @__PURE__ */ e(
|
|
59
|
-
pdf: /* @__PURE__ */ e(
|
|
60
|
-
word: /* @__PURE__ */ e(
|
|
61
|
-
excel: /* @__PURE__ */ e(
|
|
62
|
-
ppt: /* @__PURE__ */ e(
|
|
54
|
+
const le = {
|
|
55
|
+
audio: /* @__PURE__ */ e(oe, {}),
|
|
56
|
+
video: /* @__PURE__ */ e(ie, {}),
|
|
57
|
+
file: /* @__PURE__ */ e(re, {}),
|
|
58
|
+
image: /* @__PURE__ */ e(te, {}),
|
|
59
|
+
pdf: /* @__PURE__ */ e(Z, {}),
|
|
60
|
+
word: /* @__PURE__ */ e(O, {}),
|
|
61
|
+
excel: /* @__PURE__ */ e(ee, {}),
|
|
62
|
+
ppt: /* @__PURE__ */ e(Y, {})
|
|
63
63
|
};
|
|
64
|
-
function
|
|
65
|
-
const i =
|
|
66
|
-
return
|
|
64
|
+
function S(t, a = !1) {
|
|
65
|
+
const i = $(t), c = le[i] || /* @__PURE__ */ e(z, {});
|
|
66
|
+
return a ? se(i) : c;
|
|
67
67
|
}
|
|
68
|
-
const
|
|
69
|
-
wrap:
|
|
68
|
+
const ce = "_wrap_1is0r_5", de = "_placeholder_1is0r_44", he = "_placeholderText_1is0r_53", pe = "_card_1is0r_64", ue = "_downloadBtn_1is0r_82", me = "_cardLeft_1is0r_88", fe = "_iconWrap_1is0r_97", ve = "_fileInfo_1is0r_116", ge = "_fileName_1is0r_123", we = "_fileSize_1is0r_133", xe = "_cardPreview_1is0r_145", _e = "_actions_1is0r_221", ye = "_cardError_1is0r_236", Te = "_errorText_1is0r_240", o = {
|
|
69
|
+
wrap: ce,
|
|
70
|
+
placeholder: de,
|
|
71
|
+
placeholderText: he,
|
|
72
|
+
card: pe,
|
|
73
|
+
downloadBtn: ue,
|
|
74
|
+
cardLeft: me,
|
|
75
|
+
iconWrap: fe,
|
|
76
|
+
fileInfo: ve,
|
|
77
|
+
fileName: ge,
|
|
78
|
+
fileSize: we,
|
|
79
|
+
cardPreview: xe,
|
|
80
|
+
actions: _e,
|
|
81
|
+
cardError: ye,
|
|
82
|
+
errorText: Te
|
|
70
83
|
};
|
|
71
|
-
function
|
|
84
|
+
function ke({
|
|
72
85
|
editor: t,
|
|
73
|
-
node:
|
|
86
|
+
node: a,
|
|
74
87
|
updateAttributes: i,
|
|
75
|
-
deleteNode:
|
|
76
|
-
extension:
|
|
88
|
+
deleteNode: c,
|
|
89
|
+
extension: n
|
|
77
90
|
}) {
|
|
78
|
-
var
|
|
79
|
-
const
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
91
|
+
var E, b;
|
|
92
|
+
const s = J(null), r = (t == null ? void 0 : t.isEditable) ?? !1, { hasTrigger: l, fileName: h, fileSize: p, fileExt: k, fileType: N, id: d, error: L } = a.attrs, [F, g] = U(!1), { t: w } = ae(), C = (E = n == null ? void 0 : n.options) == null ? void 0 : E.upload, x = (b = n == null ? void 0 : n.options) == null ? void 0 : b.onDownload, M = y(() => {
|
|
93
|
+
var v;
|
|
94
|
+
!r || d || (v = s.current) == null || v.click();
|
|
95
|
+
}, [d, r]), V = y(
|
|
96
|
+
async (v) => {
|
|
97
|
+
const m = v.target.files && v.target.files[0];
|
|
98
|
+
if (!m) return;
|
|
99
|
+
const j = {
|
|
100
|
+
fileName: Q(m.name),
|
|
101
|
+
fileSize: m.size,
|
|
102
|
+
fileType: m.type,
|
|
103
|
+
fileExt: K(m.name)
|
|
90
104
|
};
|
|
91
|
-
|
|
105
|
+
g(!0);
|
|
92
106
|
try {
|
|
93
|
-
const
|
|
94
|
-
i({ ...
|
|
95
|
-
} catch (
|
|
107
|
+
const _ = await C(m);
|
|
108
|
+
i({ ...j, id: _ }), g(!1);
|
|
109
|
+
} catch (_) {
|
|
96
110
|
i({
|
|
97
|
-
error: `File upload fail: ${
|
|
98
|
-
}),
|
|
111
|
+
error: `File upload fail: ${_ && _.message}`
|
|
112
|
+
}), g(!1), s.current && (s.current.value = "");
|
|
99
113
|
}
|
|
100
114
|
},
|
|
101
|
-
[
|
|
115
|
+
[g, i, C]
|
|
102
116
|
);
|
|
103
|
-
|
|
104
|
-
!
|
|
105
|
-
}, [
|
|
106
|
-
const
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
] }) }) : u ? /* @__PURE__ */ e(x, { children: /* @__PURE__ */ f(
|
|
117
|
+
X(() => {
|
|
118
|
+
!d && !l && (M(), i({ hasTrigger: !0 }));
|
|
119
|
+
}, [d, l, M, i]);
|
|
120
|
+
const P = y(() => c(), [c]), D = y(() => {
|
|
121
|
+
!d || !x || x({ id: d, fileName: h, fileExt: k, fileType: N, fileSize: p });
|
|
122
|
+
}, [d, h, k, N, p, x]);
|
|
123
|
+
return r && !d ? /* @__PURE__ */ e(H, { children: /* @__PURE__ */ f(
|
|
111
124
|
"div",
|
|
112
125
|
{
|
|
113
|
-
className:
|
|
114
|
-
onClick: m,
|
|
126
|
+
className: A(o.wrap, o.placeholder, "render-wrapper"),
|
|
115
127
|
children: [
|
|
116
|
-
/* @__PURE__ */
|
|
117
|
-
|
|
118
|
-
/* @__PURE__ */ f("span", { children: [
|
|
119
|
-
d,
|
|
120
|
-
".",
|
|
121
|
-
z
|
|
122
|
-
] }),
|
|
123
|
-
/* @__PURE__ */ f("span", { children: [
|
|
124
|
-
"(",
|
|
125
|
-
N(h),
|
|
126
|
-
")"
|
|
127
|
-
] })
|
|
128
|
-
] }),
|
|
129
|
-
r && /* @__PURE__ */ e(
|
|
130
|
-
T,
|
|
131
|
-
{
|
|
132
|
-
action: B,
|
|
133
|
-
icon: "Trash2",
|
|
134
|
-
tooltip: w("editor.delete")
|
|
135
|
-
}
|
|
136
|
-
)
|
|
128
|
+
/* @__PURE__ */ e("p", { onClick: M, className: o.placeholderText, children: F ? /* @__PURE__ */ e("span", { children: w("editor.attachment.uploading") }) : /* @__PURE__ */ e("span", { children: w("editor.attachment.please_upload") }) }),
|
|
129
|
+
/* @__PURE__ */ e("input", { hidden: !0, onChange: V, ref: s, type: "file" })
|
|
137
130
|
]
|
|
138
131
|
}
|
|
139
|
-
) }) :
|
|
132
|
+
) }) : d ? /* @__PURE__ */ e(H, { children: /* @__PURE__ */ f(
|
|
140
133
|
"div",
|
|
141
134
|
{
|
|
142
|
-
className:
|
|
143
|
-
|
|
144
|
-
|
|
135
|
+
className: A(o.card, "render-wrapper", {
|
|
136
|
+
[o.cardPreview]: !r
|
|
137
|
+
}),
|
|
138
|
+
children: [
|
|
139
|
+
/* @__PURE__ */ f("div", { className: o.cardLeft, children: [
|
|
140
|
+
/* @__PURE__ */ e("div", { className: o.iconWrap, children: S(N) }),
|
|
141
|
+
/* @__PURE__ */ f("div", { className: o.fileInfo, children: [
|
|
142
|
+
/* @__PURE__ */ f("span", { className: o.fileName, children: [
|
|
143
|
+
h,
|
|
144
|
+
".",
|
|
145
|
+
k
|
|
146
|
+
] }),
|
|
147
|
+
/* @__PURE__ */ e("span", { className: o.fileSize, children: B(p) })
|
|
148
|
+
] })
|
|
149
|
+
] }),
|
|
150
|
+
/* @__PURE__ */ f("div", { className: o.actions, children: [
|
|
151
|
+
x && /* @__PURE__ */ e(
|
|
152
|
+
T,
|
|
153
|
+
{
|
|
154
|
+
action: D,
|
|
155
|
+
icon: "AttachmentDownload",
|
|
156
|
+
tooltip: w("editor.attachment.download"),
|
|
157
|
+
customClass: r ? void 0 : o.downloadBtn
|
|
158
|
+
}
|
|
159
|
+
),
|
|
160
|
+
r && /* @__PURE__ */ e(
|
|
161
|
+
T,
|
|
162
|
+
{
|
|
163
|
+
action: P,
|
|
164
|
+
icon: "Trash2",
|
|
165
|
+
tooltip: w("editor.delete")
|
|
166
|
+
}
|
|
167
|
+
)
|
|
168
|
+
] })
|
|
169
|
+
]
|
|
145
170
|
}
|
|
146
|
-
) }) : /* @__PURE__ */ e(L, {});
|
|
171
|
+
) }) : L && L !== "null" ? /* @__PURE__ */ e(H, { children: /* @__PURE__ */ e("div", { className: A(o.card, o.cardError, "render-wrapper"), children: /* @__PURE__ */ e("p", { className: o.errorText, children: L }) }) }) : /* @__PURE__ */ e(z, {});
|
|
147
172
|
}
|
|
148
|
-
function
|
|
149
|
-
const t =
|
|
150
|
-
icon:
|
|
173
|
+
function Be() {
|
|
174
|
+
const t = q(Ne.name), {
|
|
175
|
+
icon: a = void 0,
|
|
151
176
|
tooltip: i = void 0,
|
|
152
|
-
shortcutKeys:
|
|
153
|
-
tooltipOptions:
|
|
154
|
-
action:
|
|
177
|
+
shortcutKeys: c = void 0,
|
|
178
|
+
tooltipOptions: n = {},
|
|
179
|
+
action: s = void 0,
|
|
155
180
|
isActive: r = void 0
|
|
156
|
-
} = (t == null ? void 0 : t.componentProps) ?? {}, { editorDisabled:
|
|
157
|
-
|
|
181
|
+
} = (t == null ? void 0 : t.componentProps) ?? {}, { editorDisabled: l, update: h } = G(r), p = () => {
|
|
182
|
+
l || s && (s(), h());
|
|
158
183
|
};
|
|
159
184
|
return t ? /* @__PURE__ */ e(
|
|
160
185
|
T,
|
|
161
186
|
{
|
|
162
|
-
action:
|
|
163
|
-
disabled:
|
|
164
|
-
icon:
|
|
165
|
-
shortcutKeys:
|
|
187
|
+
action: p,
|
|
188
|
+
disabled: l,
|
|
189
|
+
icon: a,
|
|
190
|
+
shortcutKeys: c,
|
|
166
191
|
tooltip: i,
|
|
167
|
-
tooltipOptions:
|
|
192
|
+
tooltipOptions: n
|
|
168
193
|
}
|
|
169
|
-
) : /* @__PURE__ */ e(
|
|
194
|
+
) : /* @__PURE__ */ e(z, {});
|
|
170
195
|
}
|
|
171
|
-
const
|
|
196
|
+
const Ne = /* @__PURE__ */ I.create({
|
|
172
197
|
name: "attachment",
|
|
173
198
|
content: "",
|
|
174
199
|
marks: "",
|
|
@@ -184,10 +209,10 @@ const ce = /* @__PURE__ */ _.create({
|
|
|
184
209
|
HTMLAttributes: {
|
|
185
210
|
class: "attachment"
|
|
186
211
|
},
|
|
187
|
-
button: ({ editor:
|
|
212
|
+
button: ({ editor: a, t: i }) => ({
|
|
188
213
|
component: T,
|
|
189
214
|
componentProps: {
|
|
190
|
-
action: () =>
|
|
215
|
+
action: () => a.chain().focus().setAttachment().run(),
|
|
191
216
|
isActive: () => !1,
|
|
192
217
|
disabled: !1,
|
|
193
218
|
icon: "Attachment",
|
|
@@ -201,73 +226,83 @@ const ce = /* @__PURE__ */ _.create({
|
|
|
201
226
|
},
|
|
202
227
|
renderHTML({ HTMLAttributes: t }) {
|
|
203
228
|
const {
|
|
204
|
-
|
|
229
|
+
id: a = "",
|
|
205
230
|
fileName: i = "",
|
|
206
|
-
fileSize:
|
|
207
|
-
fileType:
|
|
208
|
-
fileExt:
|
|
231
|
+
fileSize: c = "",
|
|
232
|
+
fileType: n = "",
|
|
233
|
+
fileExt: s = ""
|
|
209
234
|
} = t || {};
|
|
210
235
|
return [
|
|
211
236
|
"div",
|
|
212
|
-
|
|
237
|
+
W(
|
|
213
238
|
// @ts-expect-error
|
|
214
239
|
this.options.HTMLAttributes || {},
|
|
215
240
|
t || {}
|
|
216
241
|
),
|
|
217
|
-
|
|
218
|
-
"
|
|
219
|
-
{
|
|
220
|
-
[
|
|
242
|
+
a ? [
|
|
243
|
+
"span",
|
|
244
|
+
{ class: "attachment__body" },
|
|
245
|
+
[
|
|
246
|
+
"span",
|
|
247
|
+
{ class: "attachment__icon" },
|
|
248
|
+
S(n, !0)
|
|
249
|
+
],
|
|
221
250
|
[
|
|
222
251
|
"span",
|
|
223
252
|
{ class: "attachment__text" },
|
|
224
|
-
`${i}.${
|
|
253
|
+
`${i}.${s} (${B(c)})`
|
|
225
254
|
]
|
|
226
255
|
] : ["div", { class: "attachment__placeholder" }]
|
|
227
256
|
];
|
|
228
257
|
},
|
|
229
258
|
addAttributes() {
|
|
230
259
|
return {
|
|
260
|
+
/**
|
|
261
|
+
* The UUID / primary key your backend assigned to this asset.
|
|
262
|
+
* This is the only persistent reference stored in the document.
|
|
263
|
+
* Use it server-side to look up, stream, delete, or generate a
|
|
264
|
+
* signed download URL for the file.
|
|
265
|
+
*/
|
|
266
|
+
id: {
|
|
267
|
+
default: null,
|
|
268
|
+
parseHTML: u("id")
|
|
269
|
+
},
|
|
231
270
|
fileName: {
|
|
232
271
|
default: null,
|
|
233
|
-
parseHTML:
|
|
272
|
+
parseHTML: u("filename")
|
|
234
273
|
},
|
|
235
274
|
fileSize: {
|
|
236
275
|
default: null,
|
|
237
|
-
parseHTML:
|
|
276
|
+
parseHTML: u("filesize")
|
|
238
277
|
},
|
|
239
278
|
fileType: {
|
|
240
279
|
default: null,
|
|
241
|
-
parseHTML:
|
|
280
|
+
parseHTML: u("filetype")
|
|
242
281
|
},
|
|
243
282
|
fileExt: {
|
|
244
283
|
default: null,
|
|
245
|
-
parseHTML:
|
|
246
|
-
},
|
|
247
|
-
url: {
|
|
248
|
-
default: null,
|
|
249
|
-
parseHTML: c("url")
|
|
284
|
+
parseHTML: u("fileext")
|
|
250
285
|
},
|
|
251
286
|
hasTrigger: {
|
|
252
287
|
default: !1,
|
|
253
|
-
parseHTML: (t) =>
|
|
288
|
+
parseHTML: (t) => u("hastrigger")(t) === "true"
|
|
254
289
|
},
|
|
255
290
|
error: {
|
|
256
291
|
default: null,
|
|
257
|
-
parseHTML:
|
|
292
|
+
parseHTML: u("error")
|
|
258
293
|
}
|
|
259
294
|
};
|
|
260
295
|
},
|
|
261
296
|
addCommands() {
|
|
262
297
|
return {
|
|
263
|
-
setAttachment: (t = {}) => ({ chain:
|
|
298
|
+
setAttachment: (t = {}) => ({ chain: a }) => a().insertContent({ type: this.name, attrs: t }).run()
|
|
264
299
|
};
|
|
265
300
|
},
|
|
266
301
|
addNodeView() {
|
|
267
|
-
return
|
|
302
|
+
return R(ke);
|
|
268
303
|
}
|
|
269
304
|
});
|
|
270
305
|
export {
|
|
271
|
-
|
|
272
|
-
|
|
306
|
+
Ne as Attachment,
|
|
307
|
+
Be as RichTextAttachment
|
|
273
308
|
};
|
package/lib/Blockquote.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("./clsx-CXbNJWDD.cjs"),p=require("./jsx-runtime-C_NLcKys.cjs"),l=require("react/jsx-runtime"),a=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("./clsx-CXbNJWDD.cjs"),p=require("./jsx-runtime-C_NLcKys.cjs"),l=require("react/jsx-runtime"),a=require("./index-Bt9LiArC.cjs");require("react");require("./theme.cjs");var g=/^\s*>\s$/,m=c.Node3.create({name:"blockquote",addOptions(){return{HTMLAttributes:{}}},content:"block+",group:"block",defining:!0,parseHTML(){return[{tag:"blockquote"}]},renderHTML({HTMLAttributes:t}){return p.h("blockquote",{...c.mergeAttributes(this.options.HTMLAttributes,t),children:p.h("slot",{})})},parseMarkdown:(t,e)=>e.createNode("blockquote",void 0,e.parseChildren(t.tokens||[])),renderMarkdown:(t,e)=>{if(!t.content)return"";const o=">",n=[];return t.content.forEach(i=>{const u=e.renderChildren([i]).split(`
|
|
2
2
|
`).map(r=>r.trim()===""?o:`${o} ${r}`);n.push(u.join(`
|
|
3
3
|
`))}),n.join(`
|
|
4
4
|
${o}
|
package/lib/Blockquote.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { N as m, w as h, m as k } from "./clsx-CDyrfCnw.js";
|
|
2
2
|
import { h as a } from "./jsx-runtime-CT7Pcg-t.js";
|
|
3
3
|
import { jsx as d, Fragment as g } from "react/jsx-runtime";
|
|
4
|
-
import { u as f, d as b, A as q } from "./index-
|
|
4
|
+
import { u as f, d as b, A as q } from "./index-8B00E8e4.js";
|
|
5
5
|
import "react";
|
|
6
6
|
import "./theme.js";
|
|
7
7
|
var v = /^\s*>\s$/, B = m.create({
|
package/lib/Bold.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./clsx-CXbNJWDD.cjs"),u=require("./jsx-runtime-C_NLcKys.cjs"),r=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./clsx-CXbNJWDD.cjs"),u=require("./jsx-runtime-C_NLcKys.cjs"),r=require("./index-Bt9LiArC.cjs"),i=require("react/jsx-runtime");require("react");require("./theme.cjs");var y=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/,_=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))/g,B=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))$/,k=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))/g,v=o.Mark.create({name:"bold",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"strong"},{tag:"b",getAttrs:t=>t.style.fontWeight!=="normal"&&null},{style:"font-weight=400",clearMark:t=>t.type.name===this.name},{style:"font-weight",getAttrs:t=>/^(bold(er)?|[5-9]\d{2,})$/.test(t)&&null}]},renderHTML({HTMLAttributes:t}){return u.h("strong",{...o.mergeAttributes(this.options.HTMLAttributes,t),children:u.h("slot",{})})},markdownTokenName:"strong",parseMarkdown:(t,e)=>e.applyMark("bold",e.parseInline(t.tokens||[])),renderMarkdown:(t,e)=>`**${e.renderChildren(t)}**`,addCommands(){return{setBold:()=>({commands:t})=>t.setMark(this.name),toggleBold:()=>({commands:t})=>t.toggleMark(this.name),unsetBold:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-b":()=>this.editor.commands.toggleBold(),"Mod-B":()=>this.editor.commands.toggleBold()}},addInputRules(){return[o.markInputRule({find:y,type:this.type}),o.markInputRule({find:B,type:this.type})]},addPasteRules(){return[o.markPasteRule({find:_,type:this.type}),o.markPasteRule({find:k,type:this.type})]}});function M(){const t=r.useButtonProps(l.name),{icon:e=void 0,tooltip:n=void 0,shortcutKeys:s=void 0,tooltipOptions:c={},action:a=void 0,isActive:p=void 0}=(t==null?void 0:t.componentProps)??{},{dataState:g,disabled:d,update:m}=r.useToggleActive(p),h=()=>{d||a&&(a(),m())};return t?i.jsx(r.ActionButton,{action:h,dataState:g,disabled:d,icon:e,shortcutKeys:s,tooltip:n,tooltipOptions:c}):i.jsx(i.Fragment,{})}const l=v.extend({addOptions(){var t;return{...(t=this.parent)==null?void 0:t.call(this),button:({editor:e,t:n,extension:s})=>({component:r.ActionButton,componentProps:{action:()=>e.commands.toggleBold(),isActive:()=>e.isActive("bold"),icon:"Bold",shortcutKeys:s.options.shortcutKeys??["mod","B"],tooltip:n("editor.bold.tooltip")}})}}});exports.Bold=l;exports.RichTextBold=M;
|
package/lib/Bold.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { M as _, e as a, f as i, m as y } from "./clsx-CDyrfCnw.js";
|
|
2
2
|
import { h as d } from "./jsx-runtime-CT7Pcg-t.js";
|
|
3
|
-
import { u as f, d as M, A as l } from "./index-
|
|
3
|
+
import { u as f, d as M, A as l } from "./index-8B00E8e4.js";
|
|
4
4
|
import { jsx as u, Fragment as v } from "react/jsx-runtime";
|
|
5
5
|
import "react";
|
|
6
6
|
import "./theme.js";
|
package/lib/BulletList.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const v=require("./index-BCzvbrf5.cjs"),s=require("react/jsx-runtime"),n=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const v=require("./index-BCzvbrf5.cjs"),s=require("react/jsx-runtime"),n=require("./index-Bt9LiArC.cjs");require("react");require("./theme.cjs");function g(){const t=n.useButtonProps(l.name),{icon:e=void 0,tooltip:i=void 0,shortcutKeys:o=void 0,tooltipOptions:r={},action:c=void 0,isActive:d=void 0}=(t==null?void 0:t.componentProps)??{},{dataState:a,disabled:u,update:p}=n.useToggleActive(d),m=()=>{u||c&&(c(),p())};return t?s.jsx(n.ActionButton,{action:m,dataState:a,disabled:u,icon:e,shortcutKeys:o,tooltip:i,tooltipOptions:r}):s.jsx(s.Fragment,{})}const l=v.BulletList.extend({addOptions(){var t;return{...(t=this.parent)==null?void 0:t.call(this),button:({editor:e,t:i,extension:o})=>({componentProps:{action:()=>e.commands.toggleBulletList(),isActive:()=>e.isActive("bulletList"),disabled:!1,shortcutKeys:o.options.shortcutKeys??["shift","mod","8"],icon:"List",tooltip:i("editor.bulletlist.tooltip")}})}}});exports.BulletList=l;exports.RichTextBulletList=g;
|
package/lib/BulletList.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { B as d } from "./index-DjDf4BK8.js";
|
|
2
2
|
import { jsx as c, Fragment as m } from "react/jsx-runtime";
|
|
3
|
-
import { u as f, d as v, A } from "./index-
|
|
3
|
+
import { u as f, d as v, A } from "./index-8B00E8e4.js";
|
|
4
4
|
import "react";
|
|
5
5
|
import "./theme.js";
|
|
6
6
|
function y() {
|
package/lib/Callout.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("./clsx-CXbNJWDD.cjs"),o=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("./clsx-CXbNJWDD.cjs"),o=require("./index-Bt9LiArC.cjs"),t=require("react/jsx-runtime"),x=require("react");require("./theme.cjs");const c=require("lucide-react"),s=require("./select-B7v1Scb-.cjs"),k=require("./index-BrxL7y9p.cjs"),j=[{value:"note",label:"Note",icon:c.Info,color:"#1f6feb",background:"#1f6feb1f"},{value:"tip",label:"Tip",icon:c.Lightbulb,color:"#238636",background:"#2386361f"},{value:"important",label:"Important",icon:c.AlertCircle,color:"#ab7df8",background:"#ab7df81f"},{value:"warning",label:"Warning",icon:c.TriangleAlert,color:"#d29922",background:"#d299221f"},{value:"caution",label:"Caution",icon:c.OctagonAlert,color:"#f85149",background:"#f851491f"}];function q({node:e}){const{type:l="note",title:r="",body:u=""}=e.attrs,d=(j.find(h=>h.value===l)||j[0]).icon;return t.jsx(a.NodeViewWrapper,{children:t.jsxs("div",{className:a.clsx("richtext-relative richtext-my-4 richtext-rounded-lg richtext-border richtext-p-4",{"richtext-bg-[#1f6feb1f] richtext-border-[#1f6feb]":l==="note","richtext-bg-[#2386361f] richtext-border-[#238636]":l==="tip","richtext-bg-[#ab7df81f] richtext-border-[#ab7df8]":l==="important","richtext-bg-[#d299221f] richtext-border-[#d29922]":l==="warning","richtext-bg-[#f851491f] richtext-border-[#f85149]":l==="caution"}),children:[t.jsxs("div",{className:a.clsx("richtext-mb-2 richtext-flex richtext-items-center richtext-gap-2",{"richtext-text-[#1f6feb]":l==="note","richtext-text-[#238636]":l==="tip","richtext-text-[#ab7df8]":l==="important","richtext-text-[#d29922]":l==="warning","richtext-text-[#f85149]":l==="caution"}),children:[t.jsx(d,{className:"richtext-size-5"}),t.jsx("span",{className:"richtext-font-semibold",children:r})]}),u&&t.jsx("p",{className:"richtext-pl-[28px]",children:u})]})})}const w=[{value:"note",label:"Note",icon:"Info"},{value:"tip",label:"Tip",icon:"Lightbulb"},{value:"important",label:"Important",icon:"AlertCircle"},{value:"warning",label:"Warning",icon:"TriangleAlert"},{value:"caution",label:"Caution",icon:"OctagonAlert"}];function M(){const{t:e}=k.useLocale(),l=o.useEditorInstance(),r=o.useButtonProps(C.name),[u,n]=x.useState(!1),[d,h]=x.useState("note"),[b,g]=x.useState(""),[f,v]=x.useState(""),{icon:y=void 0,tooltip:T=void 0,shortcutKeys:A=void 0,tooltipOptions:L={},isActive:N=void 0}=(r==null?void 0:r.componentProps)??{},{dataState:S,disabled:m}=o.useToggleActive(N),I=()=>{l&&(l.chain().focus().setCallout({type:d,title:b,body:f}).run(),n(!1),h("note"),g(""),v(""))},O=()=>{m||n(!0)};return r?t.jsxs(o.Dialog,{onOpenChange:n,open:u,children:[t.jsx(o.DialogTrigger,{asChild:!0,children:t.jsx(o.ActionButton,{action:O,dataState:S,disabled:m,icon:y,shortcutKeys:A,tooltip:T,tooltipOptions:L})}),t.jsxs(o.DialogContent,{children:[t.jsx(o.DialogTitle,{children:e("editor.callout.dialog.title")}),t.jsxs("div",{className:"richtext-space-y-4 richtext-py-4",children:[t.jsxs("div",{className:"richtext-space-y-2",children:[t.jsx(o.Label,{children:e("editor.callout.dialog.type")}),t.jsxs(s.Select,{onValueChange:h,value:d,children:[t.jsx(s.SelectTrigger,{children:t.jsx(s.SelectValue,{placeholder:e("editor.callout.dialog.type.placeholder")})}),t.jsx(s.SelectContent,{children:w.map(i=>t.jsx(s.SelectItem,{value:i.value,children:e(`editor.callout.type.${i.value}`)},i.value))})]})]}),t.jsxs("div",{className:"richtext-space-y-2",children:[t.jsx(o.Label,{children:e("editor.callout.dialog.title.label")}),t.jsx(o.Input,{onChange:i=>g(i.target.value),placeholder:e("editor.callout.dialog.title.placeholder"),value:b})]}),t.jsxs("div",{className:"richtext-space-y-2",children:[t.jsx(o.Label,{children:e("editor.callout.dialog.body.label")}),t.jsx(o.Input,{onChange:i=>v(i.target.value),placeholder:e("editor.callout.dialog.body.placeholder"),value:f})]})]}),t.jsxs(o.DialogFooter,{children:[t.jsx(o.Button,{onClick:()=>n(!1),variant:"outline",children:e("editor.callout.dialog.button.cancel")}),t.jsx(o.Button,{onClick:I,children:e("editor.callout.dialog.button.apply")})]})]})]}):t.jsx(t.Fragment,{})}function p(e){return l=>l.getAttribute(e)}const C=a.Node3.create({name:"callout",group:"block",selectable:!0,atom:!0,draggable:!0,inline:!1,addOptions(){var e;return{...(e=this.parent)==null?void 0:e.call(this),HTMLAttributes:{class:"callout"},button:({editor:l,t:r})=>({component:o.ActionButton,componentProps:{action:()=>!0,isActive:()=>l.isActive("callout"),disabled:!1,icon:"Callout",tooltip:r("editor.callout.tooltip")}})}},parseHTML(){return[{tag:"div.callout"}]},renderHTML({HTMLAttributes:e}){return["div",a.mergeAttributes(this.options&&this.options.HTMLAttributes||{},e)]},addAttributes(){return{type:{default:"",parseHTML:p("type")},title:{default:"",parseHTML:p("title")},body:{default:"",parseHTML:p("body")}}},addCommands(){return{setCallout:e=>({chain:l})=>l().insertContent({type:this.name,attrs:e}).run()}},addNodeView(){return a.ReactNodeViewRenderer(q)}});exports.Callout=C;exports.RichTextCallout=M;
|
package/lib/Callout.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { h as D, j as x, N as H, k as M, m as B } from "./clsx-CDyrfCnw.js";
|
|
2
|
-
import { h as V, u as j, d as P, D as E, m as R, A as T, n as W, o as F, L as u, j as v, p as U, B as C } from "./index-
|
|
2
|
+
import { h as V, u as j, d as P, D as E, m as R, A as T, n as W, o as F, L as u, j as v, p as U, B as C } from "./index-8B00E8e4.js";
|
|
3
3
|
import { jsx as o, jsxs as l, Fragment as Y } from "react/jsx-runtime";
|
|
4
4
|
import { useState as s } from "react";
|
|
5
5
|
import "./theme.js";
|
|
6
6
|
import { Info as _, Lightbulb as $, AlertCircle as z, TriangleAlert as K, OctagonAlert as q } from "lucide-react";
|
|
7
|
-
import { S as G, a as J, b as Q, c as X, d as Z } from "./select-
|
|
8
|
-
import { u as tt } from "./index-
|
|
7
|
+
import { S as G, a as J, b as Q, c as X, d as Z } from "./select-BxFDMaZi.js";
|
|
8
|
+
import { u as tt } from "./index-DZfkCNKr.js";
|
|
9
9
|
const y = [
|
|
10
10
|
{
|
|
11
11
|
value: "note",
|
package/lib/Clear.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const p=require("./clsx-CXbNJWDD.cjs"),n=require("react/jsx-runtime"),i=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const p=require("./clsx-CXbNJWDD.cjs"),n=require("react/jsx-runtime"),i=require("./index-Bt9LiArC.cjs");function v(){const t=i.useButtonProps(s.name),{icon:e=void 0,tooltip:o=void 0,shortcutKeys:a=void 0,tooltipOptions:u={},action:r=void 0,isActive:l=void 0}=(t==null?void 0:t.componentProps)??{},{disabled:c}=i.useActive(l),d=()=>{c||r&&r()};return t?n.jsx(i.ActionButton,{action:d,disabled:c,icon:e,shortcutKeys:a,tooltip:o,tooltipOptions:u}):n.jsx(n.Fragment,{})}const s=p.Node3.create({name:"clear",addOptions(){var t;return{...(t=this.parent)==null?void 0:t.call(this),button:({editor:e,t:o})=>({componentProps:{action:()=>e.chain().focus().clearNodes().unsetAllMarks().run(),isActive:()=>e.can().chain().focus().clearNodes().unsetAllMarks().run(),icon:"Eraser",tooltip:o("editor.clear.tooltip")}})}}});exports.Clear=s;exports.RichTextClear=v;
|
package/lib/Clear.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { N as l } from "./clsx-CDyrfCnw.js";
|
|
2
2
|
import { jsx as r, Fragment as p } from "react/jsx-runtime";
|
|
3
|
-
import { u as d, e as m, A as f } from "./index-
|
|
3
|
+
import { u as d, e as m, A as f } from "./index-8B00E8e4.js";
|
|
4
4
|
function x() {
|
|
5
5
|
const o = d(v.name), {
|
|
6
6
|
icon: t = void 0,
|